feat(coverage): add bounded PyO3 peer-evidence gate - #789
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
@opencode-agent address Integrate the published PyO3 native-extension helper into the protected central OpenCode coverage/review path on this same branch; keep the PR Draft until the integration is complete and exact-head evidence passes. Mirror the existing fail-closed R peer-evidence pattern rather than creating a second privileged reviewer. Required behavior:
Update the doctoring and CHANGELOG to distinguish source-only measurement, trusted native peer evidence, and remaining interpretation limits. Preserve immutable called-workflow source, reviewer credentials, NVIDIA/OpenCode model policy, independent approval, unresolved-thread, and branch-protection boundaries. |
|
@jules Implement the remaining central workflow integration on this existing Draft PR. Preserve the published helper and fail-closed trust boundary; do not create another PR or temporary workflow. Required scope:
Do not build PR-selected native code in the central sandbox, add a compatibility stub, skip product tests, use networked PR execution, change reviewer tokens or NVIDIA/OpenCode policy, weaken approval/protection gates, mark Ready, merge, or release. Commit as normal descendants without force-push, and report exact verification commands and the final head SHA. |
|
@jules Implement the remaining integration directly on this branch; do not create any temporary, self-modifying, encoded-patch, or branch-writing workflow. Required GREEN slice:
After integration, rerun OpenCode review for unchanged |
|
@jules Integrate the committed helper into the central Required fail-closed flow:
Do not build PR-selected native code inside the central sandbox, introduce a Python stub, auto-approve, weaken required checks, use COPILOT_GITHUB_TOKEN, or disturb the existing reviewer-agent secret contract. Update APA 7 doctoring and the authoritative changelog after GREEN. |
|
@coderabbitai Review the current Draft head |
Rate Limit Exceeded
|
|
Prepare the next bounded integration only after For the eventual current-main integration:
Keep Draft. Do not mutate the authoritative workflow from the pre-#759 base, approve, or merge. |
|
@jules Implement the existing TDD RED workflow contracts on exact live head Precondition: before every write, re-read the live head and stop without mutation unless it is the expected current head or your own direct descendant. Coverage integrationIn Initialize exactly: python_native_peer_check_required=0Only after a Python configured/default pytest/coverage command actually fails:
python3 "$GITHUB_WORKSPACE/scripts/ci/python_native_extension_peer_gate.py" classify-pytest \
--log "$log_file" \
--pyproject "$project_dir/pyproject.toml" \
--changed-files "$changed_files_file" \
--repo-root "$COVERAGE_SOURCE_WORKDIR"
and set In the compact PASS decision, when the variable is 1, emit exactly: Do not build/install PR-selected native code, add a Python stub, skip tests, or grant network access. Approval integrationMirror—but do not replace—the existing R peer-check pattern. Add independent functions that:
python3 "$GITHUB_WORKSPACE/scripts/ci/python_native_extension_peer_gate.py" require-checks \
--checks-json "$checks_file" \
--head-sha "$HEAD_SHA" \
--required-check "CI::python" \
--required-check "CI::rust" \
--required-check "CI::package"
Call this gate in both approval paths that already call Permanent tests and verificationMake the current tests GREEN without weakening them: python -m pytest -q \
tests/test_python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate_nested_project.py \
tests/test_python_native_extension_peer_gate_workflow_contract.pyThen run the permanent Python 3.10/3.14 quality workflow, focused and complete 100% production statement/branch coverage, interrogate 100%, compileall, actionlint, full central tests, security and supply-chain checks. Fix actual failures only. Preserve After GREEN, report the exact final SHA and verification commands in a PR comment. Do not request approval or change Draft state. |
|
Exact-head quality run @jules Implement the central workflow integration now rather than weakening these tests. Preserve the existing R peer gate and privileged reviewer chain. After GREEN, run full central coverage/docstrings/actionlint and replay OpenCode review against exact fast-mlsirm heads #546, #549, and #550. |
|
@opencode-agent address Fix the exact current-head quality failure on Run
Implement the documented fail-closed flow:
After GREEN, run all 90 focused tests at 100% statement/branch coverage, the complete central suite, interrogate 100%, compileall, actionlint, Python 3.10 compatibility, security workflows, and exact-head review. Keep Draft, |
|
@jules Implement the missing production integration on current branch |
|
@opencode-agent address Implement the committed workflow-integration RED contract on this Draft branch. Do not weaken the helper or tests. Preserve the existing R peer gate and reviewer credential chain. The central coverage job must capture bounded combined pytest output and status, classify only the exact unchanged maturin/PyO3 module-absence collection failure, then require trusted exact-head After GREEN, run the permanent workflow contracts, full central coverage/docstrings/actionlint/security, then replay exact current heads of fast-mlsirm #546, #549, and #550. |
|
@jules Apply and remove the committed one-shot patcher python3 scripts/ci/apply_pyo3_peer_gate_workflow_integration.py
rm scripts/ci/apply_pyo3_peer_gate_workflow_integration.py
python3 -m coverage erase
python3 -m coverage run --branch -m pytest -q \
tests/test_python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate_nested_project.py \
tests/test_python_native_extension_peer_gate_workflow_contract.py
python3 -m coverage report \
--include=scripts/ci/python_native_extension_peer_gate.py \
--show-missing --fail-under=100
python3 -m pytest -q \
tests/test_opencode_agent_contract.py \
tests/test_repository_branch_coverage_review_schedulers.py
python3 -m compileall -q \
scripts/ci/python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate_nested_project.py \
tests/test_python_native_extension_peer_gate_workflow_contract.pyThe reviewed local proof is 91 focused tests and 100% helper statement/branch coverage. The patch also removes the temporary source-snapshot workflow and the duplicate quality workflow. Keep only |
|
@opencode-agent address The branch now contains |
|
@jules @opencode-agent The implementation patcher remains committed at exact head |
|
/oc Complete the current Draft PR by applying the already reviewed permanent integration directly; do not add or retain another one-shot/branch-writer workflow.
Keep Draft until a workflow-free exact head is green. Do not build PR-selected native code in the central sandbox, alter reviewer credentials, weaken branch protection, or introduce |
|
@opencode-agent address Exact head
Apply the reviewed integration directly to Preserve the existing R peer gate and reviewer credential chain. The PyO3 classifier is a non-success deferral only. Approval must query live exact-head After direct integration, delete the patcher and temporary workflows, update permanent workflow contracts/doctoring/changelog, run Python 3.10/3.14, complete central tests, 100% production statement/branch coverage, docstrings, compilation, actionlint, security and supply-chain gates on one unchanged head. Keep Draft until GREEN. |
|
@opencode-agent address The branch has been reduced to a reviewable permanent-source state at exact head Complete the vertical slice through ordinary reviewed commits only:
Prove the exact |
|
@opencode-agent address Integrate the published PyO3 deferral helper into the permanent central workflow on exact current Draft head Required bounded implementation:
Run: python -m coverage erase
python -m coverage run -m pytest -q \
tests/test_python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate_nested_project.py \
tests/test_python_native_extension_peer_gate_workflow_contract.py
python -m coverage report
pytest -q
python -m interrogate scripts/ci
python -m compileall -q scripts/ci testsThen rerun exact-head CodeQL, Python Security, SAST, Security Scan, Secret Scan, OSV, Scorecard, SBOM, CodeRabbit/OpenCode/Noema. Keep Draft until the complete unchanged head is GREEN and independently approved. |
|
Additional current-head hardening before GREEN:
Preserve 100% branch coverage and Python 3.10 compatibility. |
|
@opencode-agent address Complete the permanent integration for exact head Wire
Update the permanent workflow contracts, quality workflow path/test/compile coverage for every current helper/test/doctoring file, authoritative doctoring and CHANGELOG. Run Python 3.10 compatibility, Python 3.14 focused and complete tests, 100% production statement/branch/docstrings, actionlint, compilation, all security/supply-chain gates, and keep Draft until the workflow-free exact head succeeds. |
|
/opencode Continue directly on The helper tests pass, but the permanent workflow-contract tests correctly fail because the gate has not yet been integrated into
Run the focused helper and workflow-contract suite first, then the complete central quality/coverage/docstring/compile/actionlint/security suite. Commit the minimal integration directly to the current branch. |
|
@opencode-agent Complete the missing permanent workflow integration on current Draft head Exact failure evidence: quality run Implement the bounded integration directly in permanent source:
Run the focused 90-test gate, complete central 100% statement/branch coverage, production docstrings, Python 3.10/3.14 compilation, actionlint, and clean-tree verification. Keep Draft; do not approve, merge, tag, release, or publish. |
|
/oc Complete the missing permanent workflow integration on exact head Directly integrate the bounded classifier and approval evidence into the permanent review workflow:
Run all five focused peer-gate test files, complete central statement/branch coverage and production docstrings, Python 3.10/3.14 compilation, actionlint, and |
|
@opencode-agent address Apply the exact-current-head integration request already specified for |
|
@jules Complete this existing Draft PR in place on Exact head
Also update the focused quality step to execute every permanent peer-gate test now in this PR, including file-safety and requirements-directory regressions, before the complete central suite. Run Python 3.10/3.14, 100% production statement/branch coverage, 100% public docstrings, compilation, actionlint, clean generated state, and all exact-head security/SAST/supply-chain gates. Keep Draft until the integrated unchanged head is fully GREEN; do not approve, mark Ready, merge, or release. |
|
@opencode-agent address Exact head Implement the three already-committed workflow contracts directly, without a patch artifact or writer workflow:
python3 "$GITHUB_WORKSPACE/scripts/ci/python_native_extension_peer_gate.py" classify-pytest \
--repo-root "$COVERAGE_SOURCE_WORKDIR" \
--pyproject "$project_dir/pyproject.toml" \
--pytest-log "$python_native_pytest_log" \
--changed-files "$python_native_changed_files"A successful classification must not become PASS. Emit the exact separate section --required-check "CI::python"
--required-check "CI::rust"
--required-check "CI::package"Require unique authoritative completed-success CheckRuns, never status contexts or stale/ambiguous reruns. Keep the R peer gate independent. A source-only deferral remains blocking until all three exact-head peer checks pass. Also implement the previously requested descriptor-bound |
|
@opencode-agent address Implement the already-specified permanent central workflow integration on this same Draft branch and exact helper contract. Wire source-only PyO3 classification into the failed Python coverage path; publish DEFERRED rather than PASS; require live exact-head |
|
Continue development on the live Draft head Implement test-first, directly in permanent authoritative sources only:
|
|
@jules Complete the declared integration slice directly on the Draft branch. Exact head
Do not build PR-selected native code in the privileged workflow, enable network in untrusted execution, add a compatibility stub, skip pytest, create a branch writer, or change reviewer identities/credentials. Keep Draft until the integrated exact head passes all gates and independent approval. |
|
@opencode-agent address Complete only the explicitly pending integration on exact head Work test-first against
Keep this branch Draft until the integration itself is GREEN and a downstream exact-head PyO3 repository run proves the intended peer-check flow. |
|
@opencode-agent address Apply and delete The patch preserves the existing R deferral and adds a separate fail-closed Python native-extension boundary:
git apply --check docs/superpowers/patches/2026-08-07-python-native-peer-workflow-integration.patch
git apply docs/superpowers/patches/2026-08-07-python-native-peer-workflow-integration.patch
rm docs/superpowers/patches/2026-08-07-python-native-peer-workflow-integration.patch
python -m pytest \
tests/test_python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate_file_safety.py \
tests/test_python_native_extension_peer_gate_nested_project.py \
tests/test_python_native_extension_peer_gate_requirements.py \
tests/test_python_native_extension_peer_gate_workflow_contract.py -q
python -m coverage erase
python -m coverage run -m pytest tests -q
python -m coverage report
python -m interrogate --fail-under 100 scripts/ci
python -m compileall -q scripts/ci tests
actionlint .github/workflows/opencode-review-dispatch.yml .github/workflows/python-native-extension-peer-gate-quality-ci.yml
git diff --check
test -z "$(git status --short)"Commit ordinary reviewed workflow source and patch deletion only. Keep Draft until one unchanged head passes the dedicated quality workflow, complete central security/SAST/supply-chain surface, fresh automated review, zero actionable threads, and qualifying independent approval. Do not build a PR-selected extension in the coverage sandbox, add network access or stubs, weaken the exact native-boundary file list, create a writer workflow, force-push, merge, release, or mark Ready. |
|
@opencode-agent address exact current head Wire
Run the focused peer-gate suite, complete central tests with 100% statement/branch coverage and public docstrings, Python 3.10/3.14 compilation, actionlint, |
|
@opencode-agent Integrate the reviewed PyO3 peer-evidence gate directly into the authoritative central workflow on this PR branch, then remove the staged patch artifact. Apply
Before production integration, strengthen |
|
@jules Apply the already reviewed patch |
|
@opencode-agent Implement the bounded PyO3 peer-evidence integration on exact current head The helper and adversarial tests are complete, but exact-head quality run Modify the protected workflow and only directly necessary permanent tests/docs/CHANGELOG:
Run the exact three failing workflow contracts first, then the complete focused and central quality gates. Final diff must contain only permanent integration/helper/tests/quality/doctoring/CHANGELOG files; no staged patch, one-shot writer, trigger, or repair workflow. Do not approve, merge, mark Ready, rebase, retarget, release, or publish. |
Buyer-visible blocker
Central OpenCode coverage currently fails before pytest collection in mature maturin/PyO3 packages when the isolated source-only sandbox cannot import the compiled native extension. This leaves otherwise verified Python-only product PRs blocked even when the exact head passes repository Python, Rust/PyO3, package, GPU, and fuzz jobs.
This bounded slice
scripts/ci/python_native_extension_peer_gate.py;module-name;CheckRunrecords by exact head SHA, workflow, check name, completed state, and success conclusion;Verification
Focused local verification on the published source:
The tests include the exact
fast_mlsirm._corefailure shape and adversarial native-boundary, filesystem, log, metadata, and check-evidence cases.Security boundary
This PR does not skip tests, build a PR-selected extension, enable network access, add a Python compatibility stub, approve a pull request, or weaken branch protection. A successful classification is explicitly not passing evidence; the final central workflow must still prove trusted exact-head Python, Rust/PyO3, and package checks.
Remaining integration
Keep this PR Draft. A follow-up commit in this PR must wire the helper into the central coverage and approval workflow, add the permanent workflow contracts, and re-run
fast-mlsirm#546on its exact current head. Until that integration is reviewed, the current fail-closed coverage behavior remains authoritative.Advances #784.